# Lake Kinneret Dataset - Usage Examples

This directory contains example scripts demonstrating how to load and visualize the Lake Kinneret multi-sensor dataset (2017-2023).

## Files

- **load_and_plot_examples.py** - Comprehensive Python script with examples for all datasets
- **output/** - Directory where generated figures are saved

## Quick Start

### Prerequisites

Install required Python packages:

```bash
pip install pandas matplotlib numpy scipy
```

### Run Examples

From this directory:

```bash
python load_and_plot_examples.py
```

This will:
1. Load all datasets from the repository
2. Generate 11 publication-quality figures
3. Save all figures to the `output/` directory
4. Print summary statistics for each dataset

### Execution Time

- **Typical runtime**: 2-5 minutes
- **Memory usage**: ~2-3 GB RAM
- **Output size**: ~15-20 MB (12 PNG files at 300 DPI)

## Datasets Covered

The example script demonstrates how to work with:

### 1. **Fluoroprobe** (In-situ phytoplankton measurements)
   - File: `fluoroprobe/fluoroprobe_2017_2023_clean.csv`
   - Examples: Vertical depth profiles, surface time series
   - Visualizes: Green algae, cyanobacteria, temperature

### 2. **Laboratory Chlorophyll** (Gold standard measurements)
   - File: `laboratory_chlorophyll/laboratory_chlorophyll_2017-2023_clean.csv`
   - Examples: Time series plot (n=153, Station A)
   - Visualizes: Fluorometric chlorophyll-a

### 3. **Satellite Chlorophyll** (Sentinel-2 retrievals)
   - Files: `satellite_chlorophyll/S2_{year}_*_chl_clean.csv`
   - Examples: Spatial distribution maps, histograms
   - Visualizes: Lake-wide chlorophyll patterns

### 4. **Meteorology** (Weather station observations)
   - File: `meteorology/meteorology_ginosar_2017-2023.csv`
   - Examples: Multi-variable overview (temperature, wind, solar, humidity)
   - Visualizes: Environmental drivers

### 5. **ML Predictions** (Phytoplankton community predictions)
   - File: `ml_predictions/phytoplankton_predictions_2017_2023.csv`
   - Examples: Individual group plots, stacked community composition
   - Visualizes: 5 phytoplankton functional groups

### 6. **Validation Data** (Quality control matchups)
   - Files: `validation/*.csv` (8 files)
   - Examples: Scatter plots, statistics tables, seasonal analysis
   - Visualizes: Satellite vs in-situ validation, laboratory comparisons

## Example Code Snippets

### Load Fluoroprobe Data

```python
import pandas as pd

df = pd.read_csv('../fluoroprobe/fluoroprobe_2017_2023_clean.csv',
                 parse_dates=['date'])

# Filter for Station A, surface waters
station_a = df[(df['station'] == 'A') & (df['depth'] < 2)]

# Plot green algae fluorescence
import matplotlib.pyplot as plt
plt.plot(station_a['date'], station_a['led 3 525 nm'])
plt.xlabel('Date')
plt.ylabel('Green Algae Fluorescence (RFU)')
plt.show()
```

### Load Satellite Chlorophyll

```python
import pandas as pd
from glob import glob

# Load all 2023 satellite data
files = glob('../satellite_chlorophyll/S2_2023_*_chl_clean.csv')
df = pd.read_csv(files[0], parse_dates=['date'])

# Plot spatial map for first date
import matplotlib.pyplot as plt
scene = df[df['date'] == df['date'].iloc[0]]
plt.scatter(scene['lon'], scene['lat'], c=scene['chl'], cmap='YlGnBu')
plt.colorbar(label='Chlorophyll-a (μg/L)')
plt.xlabel('Longitude')
plt.ylabel('Latitude')
plt.show()
```

### Load Validation Matchups

```python
import pandas as pd

# Load satellite-fluoroprobe matchups
matchups = pd.read_csv('../validation/fluoroprobe_validation_matchups_clean.csv',
                       parse_dates=['fp_date', 'sat_date'])

# Scatter plot for Station A
import matplotlib.pyplot as plt
station_a = matchups[matchups['station'] == 'A']
plt.scatter(station_a['fp_chl'], station_a['sat_chl'], alpha=0.6)
plt.plot([0, 50], [0, 50], 'k--', label='1:1 line')
plt.xlabel('Fluoroprobe Chl-a (μg/L)')
plt.ylabel('Satellite Chl-a (μg/L)')
plt.legend()
plt.show()
```


